<template>
    <div class="post_edit">
        <div class="card">
            <div class="card-body">
                <div class="mb-3">
                    <label for="edit_field" class="form-label">编辑</label>
                    <textarea v-model="content" class="form-control" id="edit_field" rows="4"></textarea>
                    <button @click="submit_a_post" type="button" class="btn btn-primary btn-sm">发帖</button>

                </div>
            </div>
        </div>
    </div>
    
    
</template>

<script>
import { ref } from 'vue';
export default {
    name: 'UserProfileEdit',
    setup(props, context) {
        let content = ref('');
        const submit_a_post = () => {
            context.emit('submit_a_post', content);
            content.value = '';
            
        };

        return {
            content,
            submit_a_post,
        }
        
        
    }
}
</script>

<style scoped>
.post_edit {
    margin-top: 20px;
}

button {
    margin-top: 5px;
    float: right;
}
</style>